<?php
include_once ('class/autoload.php'); // pour inclure nos classes
include_once ('class/config.inc.php');
$site = new page_securisee ( 'accueil' );
// Si on a cliqué sur 'Supprimer les anciens SMS', on supprime ces SMS
if (utilCoTypeC ( $_SESSION ['identifiant'] ) == 1) {
	if (isset ( $_POST ['Year'] ) && isset ( $_POST ['Month'] ) && isset ( $_POST ['tarif1'] ) && isset ( $_POST ['tarif2'] ) && isset ( $_POST ['tarif3'] ) && isset ( $_POST ['tarif4'] ) && isset ( $_POST ['tarif5'] )) {
		$site->corps = AjoutTarif();
	}
		$site->corps .= '<h2 class="form-signin-heading">Ajouter un nouveau tarif </h2><br>
			<h3>Choisir une date de prise d\'effet de la nouvelle tarification</h3>
			<form action="AjoutTarif.php" method="POST">
					<select class="monthpick form-control" name="Month">undefined<option value="1" selected>janvier</option><option value="2">février</option><option value="3">mars</option><option value="4">avril</option><option value="5">mai</option><option value="6">juin</option><option value="7">juillet</option><option value="8">août</option><option value="9">septembre</option><option value="10">octobre</option><option value="11">novembre</option><option value="12">décembre</option></select>
					<select class="yearpick form-control" name="Year">undefined<option value="2014" selected>2014</option><option value="2015" selected>2015</option><option value="2016">2016</option><option value="2017">2017</option><option value="2018">2018</option><option value="2019">2019</option><option value="2020">2020</option></select><br>
					<div class="btn btn-success">Choisir date</div>
				<div class="table-responsive">
				<table class="table table-striped table-condensed">
					<thead>
						<tr>
							<th>Quantité SMS</th>
							<th>Tarif</th>
							<th>Mise en place a partir de :</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td><input type="hidden" name="qte1" value="99"/>99</td>
							<td><input type="text" class="form-control" name="tarif1"/>€/sms</td>
							<td></td>
						</tr>
						<tr>
							<td><input type="hidden" name="qte2" value="199"/>199</td>
							<td ><input type="text" class="form-control" name="tarif2"/>€/sms</td>
							<td></td>
						</tr>
						<tr>
							<td><input type="hidden" name="qte3" value="499"/>499</td>
							<td><input type="text" class="form-control" name="tarif3"/>€/sms</td>
							<td></td>
						</tr>
						<tr>
							<td><input type="hidden" name="qte4" value="999"/>999</td>
							<td><input type="text" class="form-control" name="tarif4"/>€/sms</td>
							<td></td>
						</tr>
						<tr>
							<td><input type="hidden" name="qte5" value="1000"/>Au dessus de: 1000</td>
							<td><input type="text" class="form-control" name="tarif5"/>€/sms</td>
							<td></td>
						</tr>
					</tbody>
				</table>
				</div>
				<br><br>
			<input type="button" class="btn btn-success submit" value="Valider nouvelle tarification"/>
			</form>
  </div>
		'.jsAjoutTarif();
	
} else {
	$site->corps = 'Vous ne pouvez pas acc&eacuteder &agrave cette page.';
}
$site->affiche ();
// Nombre de SMS restant : '.smsRestant().'<br>
?>